﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace S.EliminationOrDath.Domain.Migrations
{
    public partial class 创建数据库和表 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "DeathModel",
                columns: table => new
                {
                    DeathId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    DeathDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    SheepType = table.Column<int>(type: "int", nullable: false),
                    DocumentNumber = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
                    EITag = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    DeathType = table.Column<int>(type: "int", nullable: false),
                    VarietyEnum = table.Column<int>(type: "int", nullable: false),
                    DeathSex = table.Column<bool>(type: "bit", nullable: false),
                    BuildingName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    ColumnName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    UpdateBy = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    UpdateDate = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_DeathModel", x => x.DeathId);
                });

            migrationBuilder.CreateTable(
                name: "EliminationModel",
                columns: table => new
                {
                    EliminationId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    MId = table.Column<int>(type: "int", nullable: false),
                    EITag = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    VarietyEnum = table.Column<int>(type: "int", nullable: false),
                    Types = table.Column<int>(type: "int", nullable: false),
                    BuildingName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ColumnName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DepartureState = table.Column<bool>(type: "bit", nullable: false),
                    PhaseOutDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    PhaseOutReason = table.Column<int>(type: "int", maxLength: 100, nullable: false),
                    TreatmentMeasure = table.Column<int>(type: "int", nullable: false),
                    DocumentNumber = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
                    SerialNumber = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
                    EliminationRemark = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
                    Reviewer = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    ReviewTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreateBy = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    UpdateBy = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    UpdateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    LogicalDeletion = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_EliminationModel", x => x.EliminationId);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "DeathModel");

            migrationBuilder.DropTable(
                name: "EliminationModel");
        }
    }
}
